<template>
  <div class="page-wrap login-wrap fc">
    <div class="top">
      <a-typography>
        <a-typography-title> <img src="@/assets/logo.png" class="logo" alt="logo" />Admin.Net </a-typography-title>
        <a-typography-text level="5"> 使用vue3+vite+ts+ antdVue构建的管理平台 </a-typography-text>
      </a-typography>
    </div>
    <div class="main f1">
      <a-tabs v-model:activeKey="loginState.loginType" :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }">
        <a-tab-pane key="account" tab="账号密码登录">
          <a-form :wrapper-col="{ span: 24 }">
            <a-form-item label="" v-bind="accountValidateInfos.account">
              <a-input v-model:value="accountForm.account" size="large" placeholder="账号">
                <template #prefix><UserOutlined style="color: rgba(0, 0, 0, 0.25)" /></template>
              </a-input>
            </a-form-item>
            <a-form-item label="" v-bind="accountValidateInfos.password">
              <a-input v-model:value="accountForm.password" type="password" size="large" placeholder="密码">
                <template #prefix><LockOutlined style="color: rgba(0, 0, 0, 0.25)" /></template>
              </a-input>
            </a-form-item>
          </a-form>
        </a-tab-pane>
        <a-tab-pane key="phone" tab="手机号登录">Content of Tab Pane 2</a-tab-pane>
      </a-tabs>
      <div>
        <a-checkbox v-model:checked="loginState.saveAccount">自动登录</a-checkbox>
        <router-link :to="{ path: 'forget-password' }" class="forge-password" style="float: right">忘记密码</router-link>
      </div>
      <div style="margin-top: 30px;">
        <a-button type="primary" block size="large">登录</a-button>
      </div>
    </div>
    <div class="footer">
      <div>
        <a-button type="link">帮助</a-button>
        <a-button type="link">隐私</a-button>
        <a-button type="link">条款</a-button>
      </div>
      <div>
        Copyright © 2021
        <a target="_blank" href="https://gitee.com/40288193/Admin.NET">Admin.NET</a>
        All rights reserved. v1.5.2
      </div>
    </div>
  </div>
</template>
<script lang="ts">
import { reactive, ref, toRefs, computed, watch, onMounted, onUnmounted, defineComponent } from "vue";
import { router, api, $dialog, $error, $success, $confirm, $pop, $local, $session, $cache } from "@/tools";
import { UserOutlined, LockOutlined } from "@ant-design/icons-vue";
import useLogin from "./useLogin";
export default defineComponent({
  components: { UserOutlined, LockOutlined },
  setup(props: any, ctx: any) {
    const useLoginState = useLogin();
    onMounted(() => {});
    onUnmounted(() => {});
    return {
      ...useLoginState,
    };
  },
});
</script>
<style lang="less" scoped>
.login-wrap {
  /*在此写入页面的css */
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='88' y1='88' x2='0' y2='0'%3E%3Cstop offset='0' stop-color='%23064e77'/%3E%3Cstop offset='1' stop-color='%230a7dbe'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='75' y1='76' x2='168' y2='160'%3E%3Cstop offset='0' stop-color='%238f8f8f'/%3E%3Cstop offset='0.09' stop-color='%23b3b3b3'/%3E%3Cstop offset='0.18' stop-color='%23c9c9c9'/%3E%3Cstop offset='0.31' stop-color='%23dbdbdb'/%3E%3Cstop offset='0.44' stop-color='%23e8e8e8'/%3E%3Cstop offset='0.59' stop-color='%23f2f2f2'/%3E%3Cstop offset='0.75' stop-color='%23fafafa'/%3E%3Cstop offset='1' stop-color='%23FFFFFF'/%3E%3C/linearGradient%3E%3Cfilter id='c' x='0' y='0' width='200%25' height='200%25'%3E%3CfeGaussianBlur in='SourceGraphic' stdDeviation='12' /%3E%3C/filter%3E%3C/defs%3E%3Cpolygon fill='url(%23a)' points='0 174 0 0 174 0'/%3E%3Cpath fill='%23000' fill-opacity='.5' filter='url(%23c)' d='M121.8 174C59.2 153.1 0 174 0 174s63.5-73.8 87-94c24.4-20.9 87-80 87-80S107.9 104.4 121.8 174z'/%3E%3Cpath fill='url(%23b)' d='M142.7 142.7C59.2 142.7 0 174 0 174s42-66.3 74.9-99.3S174 0 174 0S142.7 62.6 142.7 142.7z'/%3E%3C/svg%3E");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: 0 0;
  padding: 110px 0 0;
  position: relative;
  .top {
    text-align: center;
    .logo {
      height: 44px;
      vertical-align: top;
      margin-right: 16px;
      border-style: none;
    }
  }
  .main {
    width: 368px;
    min-width: 260px;
    margin: 0 auto;
  }
  .footer {
    text-align: center;
  }
}
</style>
